import React from 'react'
import { HashRouter, Route, Routes } from 'react-router-dom'
import Login from '../views/Login/Login'
import NewsSandBox from '../compoments/router/index'
export default function indexRouter() {

  return (
    <HashRouter>
      <Routes>
        <Route path='/login' element={<Login/>}/>
        <Route path="/*" element={localStorage.getItem("token") ?  <NewsSandBox/> : <Navigate to="/login"/>} />
      </Routes>

    </HashRouter>
  )
}
